package ch.simplix.android.babel;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import ch.simplix.android.speech.string.FrenchString;
import ch.simplix.android.speech.string.GermanString;
import ch.simplix.android.speech.string.ItalianString;
import ch.simplix.android.speech.string.SpanishString;
import ch.simplix.android.speech.string.UKString;
import ch.simplix.android.speech.string.USString;

public class Babel extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Intent speechIntent = new Intent("ch.simplix.android.speech.SPEECH_SERVICE");
		speechIntent.putExtra("Phrase", new USString("This is an implicit service request."));
		ComponentName name=startService(speechIntent);		
		speechIntent.putExtra("Phrase", new UKString("This is an implicit service request."));
		startService(speechIntent);
		speechIntent.putExtra("Phrase", new GermanString("Dies ist ein impliziter Aufruf eines Service."));
		startService(speechIntent);
		speechIntent.putExtra("Phrase", new FrenchString("C'est un appele implicite au service."));
		startService(speechIntent);
		speechIntent.putExtra("Phrase", new ItalianString("Questo è un implicito richiamo al servizio."));
		startService(speechIntent);
		speechIntent.putExtra("Phrase", new SpanishString("Esta es una llamada implícita al servicio."));
		startService(speechIntent);
					
	}

	@Override
	protected void onDestroy() {
		Intent speechIntent = new Intent("ch.simplix.android.speech.SPEECH_SERVICE");
		stopService(speechIntent);
		super.onDestroy();

	}
	
}